import { myUserinfo } from '@/api/login'
export default {
  namespaced: true,
  state: {
    token: '',
    userInfo: ''
  },
  mutations: {
    setToken (state, value) {
      state.token = value
    },
    setUserInfo (state, value) {
      state.userInfo = value
    },
    delToken (state) {
      state.token = ''
      state.userInfo = ''
    }
  },
  actions: {
    async getUserInfo (store) {
      // myUserinfo().then(res => {
      //   store.commit('setUserinfo', res.data)
      //   console.log('用户信息', res)
      //   console.log(3)
      // })
      const res = await myUserinfo()
      store.commit('setUserInfo', res.data)
      console.log('用户信息', res)
      console.log(3)
    }
  },
  getters: {}
}
